home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / print / hpgl2ps.zip / PLOTCOOR.C < prev    next >
C/C++ Source or Header  |  1989-08-08  |  1KB  |  68 lines

  1. /* plotcoords.c */
  2. /*
  3.  *    Define default maximum and minimum plotting coordinates.
  4.  *        P1 (xmin, ymin),  P2 (xmax, ymax)
  5.  *
  6.  *    PaperSize can be:
  7.  *            "A3" ISO (420mm by 297mm)
  8.  *            "A4" ISO (297mm by 210mm)
  9.  *            "A"  ANSI (11" by 8.5")
  10.  *            "B"  ANSI (17" by 11")
  11.  *
  12.  *    Mode can be:    "HPGL" or "DXY"
  13.  *
  14.  * Don McCormick
  15.  */
  16.  
  17. #include "defn.h"
  18.  
  19. plotcoords()
  20. {
  21.     if (strcmp(Mode, "HPGL") == 0)
  22.     {
  23.     if (strcmp(PaperSize, "A3") == 0)    /* HP-GL ISO A3 420mm * 297mm */
  24.     {
  25.         xmax = 15200;
  26.         ymax = 10800;
  27.     }
  28.     else if(strcmp(PaperSize,"A4") == 0)    /* HP-GL ISO A4 297mm * 210mm */
  29.     {
  30.         xmax = 10800;
  31.         ymax = 7680;
  32.     }
  33.     else if(strcmp(PaperSize,"A") == 0)    /* HP-GL ANSI A 11 * 8.5inch */
  34.     {
  35.         xmax = 10000;
  36.         ymax = 7200;
  37.     }
  38.     else if(strcmp(PaperSize,"B") == 0)    /* HP-GL ANSI B 17 * 11inch */
  39.     {
  40.         xmax = 15200;
  41.         ymax = 10000;
  42.     }
  43.     else 
  44.     {
  45.         fprintf(stderr,"Illegal paper size\n");
  46.         exit(-1);
  47.     }
  48.     }
  49.     else
  50.     {
  51.     if (strcmp(PaperSize, "A3") == 0)    /* DXY ISO A3 420mm * 297mm */
  52.     {
  53.         xmax = 3800;
  54.         ymax = 2700;
  55.     }
  56.     else                /* DXY ISO A4 297mm * 210mm */
  57.     {
  58.         xmax = 2700;
  59.         ymax = 1920;
  60.     }
  61.     }
  62.     /* origin at zero,zero */
  63.     xmin = ymin = 0.0;
  64.     offX = offY = 0.0;
  65.     /* default tick length percentage */
  66.     tlp = tln = 0.005;
  67. }
  68.